﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MySkiPatrolSite.ArticleSvc.ArticleList>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%: MySkiPatrolSite.Security.GetSiteName((MySkiPatrolSite.AdminSvc.Patrol)Session["PATROL"]) %> | Home Page
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2><%: ViewData["Message"] %></h2>
    <p>

        <% 
            if (MySkiPatrolSite.Security.IsLoggedIn((MySkiPatrolSite.MembershipSvc.Member)Session["MEMBER"]))
           { //PRIVATE VIEW%>
           <% //CAN THE MEMBER ADD/EDIT ARTICLES?
               if ((Session["MEMBER"] != null) && (MySkiPatrolSite.Security.IsInRole("EditArticle", (MySkiPatrolSite.MembershipSvc.Member)Session["MEMBER"])))
               { %>
                <%: MySkiPatrolSite.HtmlHelpers.ActionImage(Html, @"../Article/New/", null, "~/Images/DryIcons/Shine/png/24x24/news_add.png", "Create a new Article", "window_add_icon")%>
                <%} %>
           This is the PRIVATE VIEW

           <% Html.RenderPartial("Articles"); %>
        <%}
           else
           { //PUBLIC VIEW%>
           This is the PUBLIC VIEW

           <% Html.RenderPartial("Articles"); %>
        <%} %>

    </p>
</asp:Content>
